<%--
功能：显示一个广告
--%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ attribute name="advertisement"    type="com.probiz.estore.common.model.content.Advertisement"%>

<c:choose>
    <c:when test="${advertisement.contentType==2}">
       <OBJECT width="${advertisement.adPositionType.width}" height="${advertisement.adPositionType.height}" 
           classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 advertisementName="${advertisement.advertisementName}" positionCode="${advertisement.adPositionType.positionCode}">
       <PARAM NAME="_cx" VALUE="14552">
       <PARAM NAME="_cy" VALUE="2381">
       <PARAM NAME="FlashVars" VALUE="">
       <PARAM NAME="Movie" VALUE="${mediaPath}${advertisement.url}">
       <PARAM NAME="Src" VALUE="${mediaPath}${advertisement.url}">
       <PARAM NAME="WMode" VALUE="Transparent">
       <PARAM NAME="Play" VALUE="-1">
       <PARAM NAME="Loop" VALUE="-1">
       <PARAM NAME="Quality" VALUE="High">
       <PARAM NAME="SAlign" VALUE="">
       <PARAM NAME="Menu" VALUE="-1">
       <PARAM NAME="Base" VALUE="">
       <PARAM NAME="AllowScriptAccess" VALUE="">
       <PARAM NAME="Scale" VALUE="ShowAll">
       <PARAM NAME="DeviceFont" VALUE="0">
       <PARAM NAME="EmbedMovie" VALUE="0">
       <PARAM NAME="BGColor" VALUE="">
       <PARAM NAME="SWRemote" VALUE="">
       <PARAM NAME="MovieData" VALUE="">
       <PARAM NAME="SeamlessTabbing" VALUE="1">
       <PARAM NAME="Profile" VALUE="0">
       <PARAM NAME="ProfileAddress" VALUE="">
       <PARAM NAME="ProfilePort" VALUE="0">
       <EMBED src="${mediaPath}${advertisement.url}" WIDTH="${advertisement.adPositionType.width}" HEIGHT="${advertisement.adPositionType.height}"  TYPE="application/x-shockwave-flash"
           PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"
           WMode="Transparent">
       </EMBED>
       </OBJECT>
    </c:when>
    <c:otherwise>
       <c:choose>
           <c:when test="${not empty advertisement.redirectUrl}">
              <a target="_blank" href="${fn:indexOf(fn:toLowerCase(advertisement.redirectUrl),"http://")==0?'':ctxPath}${advertisement.redirectUrl}">
                  <img src="${mediaPath}/${advertisement.url}" width="${advertisement.adPositionType.width}" height="${advertisement.adPositionType.height}" 
                  	<c:if test="${not empty advertisement.advertisementDetail}">title="${advertisement.advertisementDetail}"</c:if>
                  	onerror="this.onerror='';this.src=__defaultImage;" adName="${advertisement.advertisementName}" positionCode="${advertisement.adPositionType.positionCode}" alt="${advertisement.advertisementName}"/>
              </a>
           </c:when>
           <c:otherwise>
              <img src="${mediaPath}${advertisement.url}" width="${advertisement.adPositionType.width}" height="${advertisement.adPositionType.height}" 
	              	<c:if test="${not empty advertisement.advertisementDetail}">title="${advertisement.advertisementDetail}"</c:if> 
	              	onerror="this.onerror='';this.src=__defaultImage;" adName="${advertisement.advertisementName}"  positionCode="${advertisement.adPositionType.positionCode}" alt="${advertisement.advertisementName}"/>
           </c:otherwise>
       </c:choose>
    </c:otherwise>
</c:choose>


